
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  
  <title>cymiao</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="blog">
<meta property="og:type" content="website">
<meta property="og:title" content="cymiao">
<meta property="og:url" content="https://cyshigehaohaizi.gitee.io/index.html">
<meta property="og:site_name" content="cymiao">
<meta property="og:description" content="blog">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="cymiao">
<meta name="twitter:description" content="blog">
  
    <link rel="alternative" href="/atom.xml" title="cymiao" type="application/atom+xml">
  
  
  <link rel="stylesheet" href="/cy_home/css/style.css">
  
    <!--<link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">-->
  
  <!--[if lt IE 9]><script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.min.js"></script><![endif]-->
  
  

</head>

<body>
<div id="container">
  <div id="wrap">
    <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <nav id="upper-nav" class="inner">
      <a id="main-nav-toggle" class="nav-icon"></a>
      <div class="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        
          <a id="nav-github" class="nav-icon" href="https://github.com/myname"></a>
        
      </div>
    </nav>
    <div id="header-title">
      
        <h1 id="blog-title-wrap">
          <a href="/" id="blog-title">My Blog</a>
        </h1>
      
    </div>
    <div id="contenedor">
      <ul class="cube">
        <li class="cara">cy</li>
        <li class="cara">A</li>
        <li class="cara">B</li>
        <li class="cara">C</li>
        <li class="cara">D</li>
        <li class="cara">E</li>
      </ul>
    </div>
    <nav id="main-nav">
      
        <a class="main-nav-link" href="/cy_home/">Home</a>
      
        <a class="main-nav-link" href="/cy_home/archives">Archives</a>
      
        <a class="main-nav-link" href="/cy_home/about">About</a>
      
      <a class="main-nav-link st-search-show-outputs">搜索</a>
    </nav>
  </div>
</header>

    <div class="outer">
      <section id="main">
  
    <article id="post-npm/npm组件发布" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <h3 href="/cy_home/2018/10/27/npm/npm组件发布/" class="article-date">
  <time datetime="2018-10-27T03:04:34.000Z" itemprop="datePublished">2018-10-27</time>
</h3>
    
  </div>
  <div class="article-inner">
  <div class="curve-down">
  <div class="fill-content">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/cy_home/2018/10/27/npm/npm组件发布/">npm + webpack + vue 创建发布一个组件</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        
        <p>做一个npm上创建发布vue组件的例子</p>
<h4 id="环境准备"><a href="#环境准备" class="headerlink" title="环境准备"></a>环境准备</h4><ol>
<li>需要安装<code>nodejs</code></li>
<li><p>需要配置<code>npm</code>地址,我这里配置的是私有仓库地址(当然你也可以配置其他仓库的):</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">registry</span> = <span class="string">"http://192.168.17.18:7001/"</span></span><br></pre></td></tr></table></figure>
</li>
</ol>
<h4 id="项目初始化"><a href="#项目初始化" class="headerlink" title="项目初始化"></a>项目初始化</h4><p>因为我们创建的是一个vue组件,用不着复杂的打包,所以我们这里使用<code>webpack-simple</code>来初始化项目,非常简单.</p>
<ol>
<li>首先我们这里创建一个 vue_demo组件</li>
</ol>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="selector-tag">F</span>:\<span class="selector-tag">npm</span>&gt;<span class="selector-tag">vue</span> <span class="selector-tag">init</span> <span class="selector-tag">webpack-simple</span> <span class="selector-tag">vue_demo</span></span><br><span class="line"></span><br><span class="line">  <span class="selector-tag">A</span> <span class="selector-tag">newer</span> <span class="selector-tag">version</span> <span class="selector-tag">of</span> <span class="selector-tag">vue-cli</span> <span class="selector-tag">is</span> <span class="selector-tag">available</span>.</span><br><span class="line"></span><br><span class="line">  <span class="selector-tag">latest</span>:    2<span class="selector-class">.9</span><span class="selector-class">.6</span></span><br><span class="line">  <span class="selector-tag">installed</span>: 2<span class="selector-class">.9</span><span class="selector-class">.3</span></span><br><span class="line"></span><br><span class="line">? <span class="selector-tag">Project</span> <span class="selector-tag">name</span> <span class="selector-tag">vue_demo</span></span><br><span class="line">? <span class="selector-tag">Project</span> <span class="selector-tag">description</span> <span class="selector-tag">A</span> <span class="selector-tag">Vue</span><span class="selector-class">.js</span> <span class="selector-tag">project</span></span><br><span class="line">? <span class="selector-tag">Author</span> <span class="selector-tag">cyshigehaohaizi</span> &lt;<span class="selector-tag">cyshigehaohaizi</span>@<span class="keyword">163</span>.<span class="keyword">com</span>&gt;</span><br><span class="line">? License MIT</span><br><span class="line">? Use sass? Yes</span><br><span class="line"></span><br><span class="line">   vue-cli · Generated <span class="string">"vue_demo"</span>.</span><br><span class="line"></span><br><span class="line">   To get started:</span><br><span class="line"></span><br><span class="line">     cd vue_demo</span><br><span class="line">     npm install</span><br><span class="line">     npm run dev</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">F:\npm&gt;</span><br></pre></td></tr></table></figure>
<ol start="2">
<li>然后在目录下我们可以看到<code>vue_demo</code>文件夹:</li>
</ol>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">│  .babelrc</span><br><span class="line">│  .editorconfig</span><br><span class="line">│  .gitignore</span><br><span class="line">│  index.html</span><br><span class="line">│  package.json</span><br><span class="line">│  README.md</span><br><span class="line">│  webpack<span class="selector-class">.config</span><span class="selector-class">.js</span></span><br><span class="line">│</span><br><span class="line">│</span><br><span class="line">└─src</span><br><span class="line">    │  App.vue</span><br><span class="line">    │  main.js</span><br><span class="line">    │</span><br><span class="line">    └─assets</span><br><span class="line">            logo.png</span><br></pre></td></tr></table></figure>
<ol start="3">
<li>初始化项目,在目录下运行<code>npm install</code></li>
</ol>
<figure class="highlight coffeescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">F:\<span class="built_in">npm</span>\vue_demo&gt;<span class="built_in">npm</span> install</span><br></pre></td></tr></table></figure>
<ol start="4">
<li>通过<code>README</code>文档可以看到启动的脚本</li>
</ol>
<figure class="highlight dockerfile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># install dependencies</span></span><br><span class="line">npm install</span><br><span class="line"></span><br><span class="line"><span class="comment"># serve with hot reload at localhost:8080</span></span><br><span class="line">npm <span class="keyword">run</span><span class="bash"> dev</span></span><br><span class="line"><span class="bash"></span></span><br><span class="line"><span class="bash"><span class="comment"># build for production with minification</span></span></span><br><span class="line"><span class="bash">npm run build</span></span><br></pre></td></tr></table></figure>
<p>我们启动测试下:<br><figure class="highlight coffeescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">F:\<span class="built_in">npm</span>\vue_demo&gt;<span class="built_in">npm</span> run dev</span><br><span class="line"></span><br><span class="line">&gt; vue_demo@<span class="number">1.0</span><span class="number">.0</span> dev F:\<span class="built_in">npm</span>\vue_demo</span><br><span class="line">&gt; cross-env NODE_ENV=development webpack-dev-server --open --hot</span><br><span class="line"></span><br><span class="line">Project <span class="keyword">is</span> running at http:<span class="regexp">//</span>localhost:<span class="number">8080</span>/</span><br><span class="line">webpack output <span class="keyword">is</span> served <span class="keyword">from</span> <span class="regexp">/dist/</span></span><br><span class="line"><span class="number">404</span>s will fallback to /index.html</span><br></pre></td></tr></table></figure></p>
<p>启动成功! 访问:<a href="http://localhost:8080/" target="_blank" rel="noopener">http://localhost:8080/</a><br>可以看到我们生成的vue页面!接下来我们来写组件.</p>
<h4 id="组件书写并发布"><a href="#组件书写并发布" class="headerlink" title="组件书写并发布"></a>组件书写并发布</h4><p>我这里封装一个简单的输入框<code>simpleText</code></p>
<ol>
<li>文件目录如下:<br>这里我们把组件放在<code>src/simpleText</code>中:</li>
</ol>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">-src             <span class="comment">//源目录</span></span><br><span class="line">   │  App<span class="selector-class">.vue</span>    <span class="comment">//测试页面入口文件</span></span><br><span class="line">   │  main<span class="selector-class">.js</span>    <span class="comment">//测试页面vue文件</span></span><br><span class="line">   │</span><br><span class="line">   ├─assets      <span class="comment">//资源</span></span><br><span class="line">   │      logo.png</span><br><span class="line">   │</span><br><span class="line">   └─simpleText  <span class="comment">//组件目录</span></span><br><span class="line">       │  index<span class="selector-class">.js</span> <span class="comment">//组件入口文件</span></span><br><span class="line">       │</span><br><span class="line">       └─src    <span class="comment">//组件源目录</span></span><br><span class="line">               simpleText<span class="selector-class">.vue</span> <span class="comment">//vue组件</span></span><br><span class="line">-index<span class="selector-class">.html</span>     <span class="comment">//测试入口html文件</span></span><br></pre></td></tr></table></figure>
<ol start="2">
<li>组件书写</li>
</ol>
<ul>
<li>组件功能书写:<code>simpleText/src/simpleText.vue</code></li>
</ul>
<figure class="highlight django"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br></pre></td><td class="code"><pre><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">template</span>&gt;</span></span></span><br><span class="line"><span class="xml">   <span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">"simple-text"</span>&gt;</span></span></span><br><span class="line"><span class="xml">       <span class="tag">&lt;<span class="name">span</span> <span class="attr">v-if</span>=<span class="string">"label!=''?true:false"</span>&gt;</span></span><span class="template-variable">&#123;&#123;label&#125;&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">span</span>&gt;</span></span></span><br><span class="line"><span class="xml">       <span class="tag">&lt;<span class="name">input</span> <span class="attr">type</span>=<span class="string">"text"</span> <span class="attr">:value</span>=<span class="string">"text"</span> @<span class="attr">input</span>=<span class="string">"changeValue($event.target.value)"</span>&gt;</span></span></span><br><span class="line"><span class="xml">   <span class="tag">&lt;/<span class="name">span</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">template</span>&gt;</span></span></span><br><span class="line"><span class="xml"></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="undefined"></span></span></span><br><span class="line"><span class="xml">  export default &#123;</span></span><br><span class="line"><span class="xml">    name: "simple-text",</span></span><br><span class="line"><span class="xml">    props: &#123;</span></span><br><span class="line"><span class="xml">      value: &#123;</span></span><br><span class="line"><span class="xml">        type: String,</span></span><br><span class="line"><span class="xml">        default: ''</span></span><br><span class="line"><span class="xml">      &#125;,</span></span><br><span class="line"><span class="xml">      label: &#123;</span></span><br><span class="line"><span class="xml">        type: String,</span></span><br><span class="line"><span class="xml">        default: ''</span></span><br><span class="line"><span class="xml">      &#125;</span></span><br><span class="line"><span class="xml">    &#125;,</span></span><br><span class="line"><span class="xml">    data() &#123;</span></span><br><span class="line"><span class="xml">      return &#123;</span></span><br><span class="line"><span class="xml">        text: this.value,</span></span><br><span class="line"><span class="xml">      &#125;</span></span><br><span class="line"><span class="xml">    &#125;,</span></span><br><span class="line"><span class="xml">    methods: &#123;</span></span><br><span class="line"><span class="xml">      changeValue(value) &#123;</span></span><br><span class="line"><span class="xml">        this.text = value;</span></span><br><span class="line"><span class="xml">        this.$emit('update:value',this.text);</span></span><br><span class="line"><span class="xml">      &#125;</span></span><br><span class="line"><span class="xml">    &#125;</span></span><br><span class="line"><span class="xml"></span></span><br><span class="line"><span class="xml">  &#125;</span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br><span class="line"><span class="xml"></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">style</span> <span class="attr">scoped</span> <span class="attr">lang</span>=<span class="string">"scss"</span> <span class="attr">type</span>=<span class="string">"text/scss"</span>&gt;</span><span class="undefined"></span></span></span><br><span class="line"><span class="xml">  .simple-text &#123;</span></span><br><span class="line"><span class="xml">    input &#123;</span></span><br><span class="line"><span class="xml">      outline-color:darkturquoise ;</span></span><br><span class="line"><span class="xml">      border-radius: 4px;</span></span><br><span class="line"><span class="xml">      border: 1px solid #cccc;</span></span><br><span class="line"><span class="xml">      padding: 4px 6px;</span></span><br><span class="line"><span class="xml">      margin-right: 4px;</span></span><br><span class="line"><span class="xml"></span></span><br><span class="line"><span class="xml">    &#125;</span></span><br><span class="line"><span class="xml">  &#125;</span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">style</span>&gt;</span></span></span><br></pre></td></tr></table></figure>
<ul>
<li>实现组件的install方法并export组件:<code>simpleText/index.js</code></li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> simpleText <span class="keyword">from</span> <span class="string">'./src/simpleText'</span> <span class="comment">// 导入组件</span></span><br><span class="line"><span class="comment">//实现组件的install方法</span></span><br><span class="line">simpleText.install = <span class="function">(<span class="params">Vue, options</span>) =&gt;</span> &#123;</span><br><span class="line">  <span class="comment">// simpleText.name 组件的name属性</span></span><br><span class="line">  Vue.component(simpleText.name, simpleText)</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">export</span> <span class="keyword">default</span> simpleText <span class="comment">// 导出组件</span></span><br></pre></td></tr></table></figure>
<ol start="3">
<li>配置组件<code>webpack</code>的测试环境以及打包环境,我这里只贴出主要配置:<code>webpack.config.js</code></li>
</ol>
<figure class="highlight arduino"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">var <span class="built_in">config</span>=&#123;</span><br><span class="line">  <span class="comment">//配置开发测试入口以及出口文件名称</span></span><br><span class="line">  dev:&#123;</span><br><span class="line">    entry: <span class="string">'./src/main.js'</span>,</span><br><span class="line">    filename:<span class="string">'build.js'</span></span><br><span class="line">  &#125;,</span><br><span class="line">  <span class="comment">//配置打包入口以及出口文件名称</span></span><br><span class="line">  build:&#123;</span><br><span class="line">    entry: <span class="string">'./src/simpleText/index.js'</span>,</span><br><span class="line">    filename: <span class="string">'simple-text.js'</span></span><br><span class="line">  &#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">module</span>.exports = &#123;</span><br><span class="line">  entry: <span class="built_in">process</span>.env.NODE_ENV==<span class="string">"development"</span>?<span class="built_in">config</span>.dev.entry:<span class="built_in">config</span>.build.entry,</span><br><span class="line">  output: &#123;</span><br><span class="line">    path: path.resolve(__dirname, <span class="string">'./dist'</span>),</span><br><span class="line">    publicPath: <span class="string">'/dist/'</span>,</span><br><span class="line">    filename: <span class="built_in">process</span>.env.NODE_ENV==<span class="string">"development"</span>?<span class="built_in">config</span>.dev.filename:<span class="built_in">config</span>.build.filename,</span><br><span class="line">    <span class="comment">// library指定的就是你使用require时的模块名</span></span><br><span class="line">    library: <span class="string">'simpleText'</span>,</span><br><span class="line">    libraryTarget: <span class="string">'umd'</span>,</span><br><span class="line"></span><br><span class="line">  &#125;,</span><br><span class="line">  ...</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<ol start="4">
<li><p>测试组件</p>
<ul>
<li>引入组件:<code>main.js</code></li>
</ul>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> Vue <span class="keyword">from</span> <span class="string">'vue'</span></span><br><span class="line"><span class="keyword">import</span> App <span class="keyword">from</span> <span class="string">'./App.vue'</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">//引入没有打包的simpleText组件测试</span></span><br><span class="line"><span class="comment">// import simpleText from './simpleText/index.js'</span></span><br><span class="line"><span class="comment">//引入打包好(npm run build)的simpleText组件测试</span></span><br><span class="line"><span class="keyword">import</span> simpleText <span class="keyword">from</span> <span class="string">'../dist/simple-text'</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//注册插件搭配Vue上</span></span><br><span class="line">Vue.use(simpleText);</span><br><span class="line"></span><br><span class="line"><span class="keyword">new</span> Vue(&#123;</span><br><span class="line">  el: <span class="string">'#app'</span>,</span><br><span class="line">  render: <span class="function"><span class="params">h</span> =&gt;</span> h(App)</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>
<ul>
<li>使用组件 :<code>app.vue</code></li>
</ul>
<figure class="highlight django"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">template</span>&gt;</span></span></span><br><span class="line"><span class="xml">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">"app"</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">img</span> <span class="attr">src</span>=<span class="string">"./assets/logo.png"</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">h1</span>&gt;</span></span><span class="template-variable">&#123;&#123; msg &#125;&#125;</span><span class="xml"><span class="tag">&lt;/<span class="name">h1</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">simple-text</span> <span class="attr">label</span>=<span class="string">"simpleText"</span> <span class="attr">:value.sync</span>=<span class="string">"value"</span>&gt;</span><span class="tag">&lt;/<span class="name">simple-text</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">br</span>/&gt;</span></span></span><br><span class="line"><span class="xml">    输入值:</span></span><br><span class="line"><span class="xml">    </span><span class="template-variable">&#123;&#123;value&#125;&#125;</span><span class="xml"></span></span><br><span class="line"><span class="xml">  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">template</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="undefined"></span></span></span><br><span class="line"><span class="xml">  export default &#123;</span></span><br><span class="line"><span class="xml">    name: 'app',</span></span><br><span class="line"><span class="xml">    data() &#123;</span></span><br><span class="line"><span class="xml">      return &#123;</span></span><br><span class="line"><span class="xml">        msg: '这个是我的simpleText测试组件',</span></span><br><span class="line"><span class="xml">        value: 'text value'</span></span><br><span class="line"><span class="xml">      &#125;</span></span><br><span class="line"><span class="xml">    &#125;</span></span><br><span class="line"><span class="xml">  &#125;</span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br></pre></td></tr></table></figure>
<ul>
<li>运行测试 :<code>npm run dev</code></li>
</ul>
<figure class="highlight coffeescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">F:\<span class="built_in">npm</span>\vue_demo&gt;<span class="built_in">npm</span> run dev</span><br><span class="line"></span><br><span class="line">&gt; vue_demo@<span class="number">1.0</span><span class="number">.0</span> dev F:\<span class="built_in">npm</span>\vue_demo</span><br><span class="line">&gt; cross-env NODE_ENV=development webpack-dev-server --open --hot</span><br><span class="line"></span><br><span class="line">Project <span class="keyword">is</span> running at http:<span class="regexp">//</span>localhost:<span class="number">8080</span>/</span><br><span class="line">webpack output <span class="keyword">is</span> served <span class="keyword">from</span> <span class="regexp">/dist/</span></span><br><span class="line"><span class="number">404</span>s will fallback to /index.html</span><br></pre></td></tr></table></figure>
<p>访问:<a href="http://localhost:8080/" target="_blank" rel="noopener">http://localhost:8080/</a></p>
<p><img src="/cy_home/2018/10/27/npm/npm组件发布/1.png" alt="图片"></p>
</li>
<li><p>打包组件 :</p>
</li>
</ol>
<figure class="highlight subunit"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">F:\npm\vue_demo&gt;npm run build</span><br><span class="line"></span><br><span class="line">&gt; vue_demo@1.0.0 build F:\npm\vue_demo</span><br><span class="line">&gt; cross-env NODE_ENV=production webpack --progress --hide-modules</span><br><span class="line"></span><br><span class="line">Hash: 8d907091c438ffae8acf</span><br><span class="line">Version: webpack 3.12.0</span><br><span class="line"><span class="keyword">Time:</span> 1928ms</span><br><span class="line">             Asset     Size  Chunks             Chunk Names</span><br><span class="line">    simple-text.js  6.13 kB       0  [emitted]  main</span><br><span class="line">simple-text.js.map  51.8 kB       0  [emitted]  main</span><br><span class="line"></span><br><span class="line">F:\npm\vue_demo&gt;</span><br></pre></td></tr></table></figure>
<ol start="6">
<li>发布组件</li>
</ol>
<ul>
<li>修改<code>package.json</code>文件:</li>
</ul>
<figure class="highlight jboss-cli"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"name"</span>: <span class="string">"@yh/simple-text"</span>,<span class="string">//</span>注意如果是私有仓库一定要指明名称,我这里在@yh下</span><br><span class="line"><span class="string">"description"</span>: <span class="string">"A Vue.js project"</span>,</span><br><span class="line"><span class="string">"version"</span>: <span class="string">"1.0.0"</span>,<span class="string">//</span>版本号</span><br><span class="line"><span class="string">"author"</span>: <span class="string">"cyshigehaohaizi &lt;cyshigehaohaizi@163.com&gt;"</span>,</span><br><span class="line"><span class="string">"license"</span>: <span class="string">"MIT"</span>,<span class="string">//</span>许可证</span><br><span class="line"><span class="string">"private"</span>: <span class="literal">false</span>,<span class="string">//</span>改为<span class="literal">false</span></span><br><span class="line"><span class="string">"main"</span>:<span class="string">"dist/simple-text.js"</span>,<span class="string">//</span>直接使用import simpleText 就可以获取到simple-text.js</span><br><span class="line">   <span class="string">"directories"</span>: &#123;</span><br><span class="line">     <span class="string">"dist"</span>: <span class="string">"dist"</span></span><br><span class="line">   &#125;,</span><br><span class="line">  <span class="string">"repository"</span>: &#123;</span><br><span class="line">    <span class="string">"type"</span>: <span class="string">"git"</span>,</span><br><span class="line">    <span class="string">"url"</span>: <span class="string">"http://192.168.17.18:7001/"</span><span class="string">//</span>这个是配置的仓库地址,我这里配置的是公司的私有仓库</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>
<ul>
<li>注册 npm 并添加用户:</li>
</ul>
<figure class="highlight groovy"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">npm adduser</span><br><span class="line"><span class="string">Username:</span> your name</span><br><span class="line"><span class="string">Password:</span> your password</span><br><span class="line"><span class="string">Email:</span> yourmail<span class="meta">@xx</span>.com</span><br></pre></td></tr></table></figure>
<ul>
<li>登陆npm账号:<code>npm login</code></li>
</ul>
<figure class="highlight less"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">F</span>:\npm\vue_demo&gt;npm login  #登陆npm账号</span><br><span class="line"><span class="attribute">Username</span>: your name</span><br><span class="line"><span class="attribute">Password</span>: your password</span><br><span class="line"><span class="attribute">Email</span>: yourmail<span class="variable">@xx</span>.com</span><br><span class="line">Logged in as your name on <span class="attribute">http</span>:<span class="comment">//192.168.17.18:7001/.</span></span><br></pre></td></tr></table></figure>
<ul>
<li>发布:<code>npm publish</code></li>
</ul>
<figure class="highlight less"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">F</span>:\npm\vue_demo&gt;npm publish</span><br><span class="line">+ <span class="variable">@yh</span>/simple-text<span class="variable">@1</span>.<span class="number">0.0</span></span><br></pre></td></tr></table></figure>
<h4 id="组件下载使用"><a href="#组件下载使用" class="headerlink" title="组件下载使用"></a>组件下载使用</h4><ul>
<li>这里我们在新一个测试项目,在目录下下载我们的组件:<code>npm install @yh/simple-text</code></li>
</ul>
<figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">F:\vue_pro&gt;cd ta404-ui-cli</span><br><span class="line"></span><br><span class="line">F:\vue_pro\ta404-ui-cli&gt;npm install @yh/simple-text</span><br><span class="line">npm WARN ajv-keywords@3.1.0 requires a<span class="built_in"> peer </span>of ajv@^6.0.0 but none is installed. You must install<span class="built_in"> peer </span>dependencies yourself.</span><br><span class="line">npm WARN eslint-config-vue@2.0.2 requires a<span class="built_in"> peer </span>of eslint@^2.0.0 || ^3.0.0 but none is installed. You must install<span class="built_in"> peer </span>dependencies yourself.</span><br><span class="line">npm WARN eslint-config-vue@2.0.2 requires a<span class="built_in"> peer </span>of eslint-plugin-vue@^1.0.0 || ^2.0.0 but none is installed. You must install<span class="built_in"> peer </span>dependencies yourself.</span><br><span class="line">npm WARN eslint-plugin-vue@4.7.0 requires a<span class="built_in"> peer </span>of eslint@^3.18.0 || ^4.0.0 but none is installed. You must install<span class="built_in"> peer </span>dependencies yourself.</span><br><span class="line">npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):</span><br><span class="line">npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform <span class="keyword">for</span> fsevents@1.2.4: wanted &#123;<span class="string">"os"</span>:<span class="string">"darwin"</span>,<span class="string">"arch"</span>:<span class="string">"any"</span>&#125; (current: &#123;<span class="string">"os"</span>:<span class="string">"win32"</span>,<span class="string">"arch"</span>:<span class="string">"x64"</span>&#125;)</span><br><span class="line"></span><br><span class="line">+ @yh/simple-text@1.0.0</span><br><span class="line">added 2 packages <span class="keyword">in</span> 34.026s</span><br></pre></td></tr></table></figure>
<ul>
<li>使用这个组件:</li>
</ul>
<p><code></code></p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//simpleTextDemo.js</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> Vue <span class="keyword">from</span> <span class="string">'vue'</span>;</span><br><span class="line"><span class="keyword">import</span> simpleTextDemo <span class="keyword">from</span> <span class="string">'./simpleTextDemo.vue'</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> simpleText <span class="keyword">from</span> <span class="string">'@yh/simple-text'</span><span class="comment">//引入simpleText插件</span></span><br><span class="line">Vue.use(simpleText);<span class="comment">//注册插件</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">new</span> Vue(&#123;</span><br><span class="line">   render: <span class="function"><span class="params">h</span> =&gt;</span> h(simpleTextDemo)</span><br><span class="line">&#125;).$mount(<span class="string">'#app'</span>);</span><br></pre></td></tr></table></figure>
<figure class="highlight django"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="xml">//simpleTextDemo.vue</span></span><br><span class="line"><span class="xml"></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">template</span>&gt;</span></span></span><br><span class="line"><span class="xml">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">"app"</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">h1</span>&gt;</span>组件测试simpleText<span class="tag">&lt;/<span class="name">h1</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">simple-text</span> <span class="attr">label</span>=<span class="string">"simpleText"</span> <span class="attr">:value.sync</span>=<span class="string">"value"</span>&gt;</span><span class="tag">&lt;/<span class="name">simple-text</span>&gt;</span></span></span><br><span class="line"><span class="xml">    <span class="tag">&lt;<span class="name">br</span>&gt;</span></span></span><br><span class="line"><span class="xml">    输入的值:</span></span><br><span class="line"><span class="xml">    </span><span class="template-variable">&#123;&#123;value&#125;&#125;</span><span class="xml"></span></span><br><span class="line"><span class="xml">  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">template</span>&gt;</span></span></span><br><span class="line"><span class="xml"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="undefined"></span></span></span><br><span class="line"><span class="xml"></span></span><br><span class="line"><span class="xml">  export default &#123;</span></span><br><span class="line"><span class="xml">    name: 'simpleTextDemo',</span></span><br><span class="line"><span class="xml">    data() &#123;</span></span><br><span class="line"><span class="xml">      return &#123;</span></span><br><span class="line"><span class="xml">        value: "测试"</span></span><br><span class="line"><span class="xml">      &#125;</span></span><br><span class="line"><span class="xml">    &#125;,</span></span><br><span class="line"><span class="xml">  &#125;</span></span><br><span class="line"><span class="xml"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br></pre></td></tr></table></figure>
<p>启动测试正常:<br>  <img src="/cy_home/2018/10/27/npm/npm组件发布/2.png" alt="图片"></p>

      
    </div>
    <footer class="article-footer">
      <div class="article-footer-content">
        
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/cy_home/tags/npm/">npm</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/cy_home/tags/vue/">vue</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/cy_home/tags/webpack/">webpack</a></li></ul>

        <a data-url="https://cyshigehaohaizi.gitee.io/2018/10/27/npm/npm组件发布/" data-id="cjnr90az80008ok76vli6kflw" class="article-share-link">分享到</a>
        
      </div>
    </footer>
  </div>
  </div>
  </div>
  
</article>



  
    <article id="post-npm" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <h3 href="/cy_home/2018/10/27/npm/" class="article-date">
  <time datetime="2018-10-27T03:02:06.000Z" itemprop="datePublished">2018-10-27</time>
</h3>
    
  </div>
  <div class="article-inner">
  <div class="curve-down">
  <div class="fill-content">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/cy_home/2018/10/27/npm/">npm</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        
        
      
    </div>
    <footer class="article-footer">
      <div class="article-footer-content">
        
        <a data-url="https://cyshigehaohaizi.gitee.io/2018/10/27/npm/" data-id="cjnr90awz0000ok76osn27bp3" class="article-share-link">分享到</a>
        
      </div>
    </footer>
  </div>
  </div>
  </div>
  
</article>



  
    <article id="post-node/node使用记录" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <h3 href="/cy_home/2018/08/07/node/node使用记录/" class="article-date">
  <time datetime="2018-08-07T06:44:00.000Z" itemprop="datePublished">2018-08-07</time>
</h3>
    
  </div>
  <div class="article-inner">
  <div class="curve-down">
  <div class="fill-content">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/cy_home/2018/08/07/node/node使用记录/">node使用记录</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        
        <h3 id="node使用小知识"><a href="#node使用小知识" class="headerlink" title="node使用小知识"></a>node使用小知识</h3><ol>
<li>在使用npm运行两个监听端口的时候比如我需要运行mockserver 以及 项目,如下:</li>
</ol>
<figure class="highlight xquery"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"scripts"</span>: &#123;</span><br><span class="line">  <span class="string">"dev"</span>: <span class="string">"webpack-dev-server --inline --progress --config build/webpack.dev.conf.js"</span>,</span><br><span class="line">  <span class="string">"start"</span>: <span class="string">"npm run dev"</span>,</span><br><span class="line">  <span class="string">"build"</span>: <span class="string">"node build/build.js"</span>,</span><br><span class="line">  <span class="string">"mock"</span>:<span class="string">"node net.js http://192.168.17.18:10000/mock/5b68f9b10b81e375f173f0ed http://localhost:8081"</span>,</span><br><span class="line">  <span class="string">"qts"</span>:<span class="string">"npm run start &amp;&amp; npm run mock "</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>我需要同时运行start和mock 使用第三种方式始终只会运行第一个,这里需要安装一个npm 插件<code>concurrently</code>,我这里安装在全局</p>
<figure class="highlight cmake"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm <span class="keyword">install</span> -g concurrently</span><br></pre></td></tr></table></figure>
<p>这里再查看下<code>concurrently</code>语法:</p>
<p>控制台直接使用:</p>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">concurrently</span> <span class="string">"command1 arg"</span> <span class="string">"command2 arg"</span></span><br></pre></td></tr></table></figure>
<p>在package.json中也可以配置:</p>
<figure class="highlight 1c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line"><span class="string">"start"</span>: <span class="string">"concurrently \"</span>command1 arg\<span class="string">" \"</span>command2 arg\<span class="string">""</span></span><br></pre></td></tr></table></figure>
<p>那么我们这里需要吧qts命令改下:</p>
<figure class="highlight autoit"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">"qts"</span>: <span class="string">"concurrently \"</span>npm <span class="built_in">run</span> start\<span class="string">" \"</span>npm <span class="built_in">run</span> mock\<span class="string">""</span></span><br></pre></td></tr></table></figure>
<p>好了现在我们执行<code>npm run qts</code>两句都执行成功</p>

      
    </div>
    <footer class="article-footer">
      <div class="article-footer-content">
        
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/cy_home/tags/node/">node</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/cy_home/tags/npm/">npm</a></li></ul>

        <a data-url="https://cyshigehaohaizi.gitee.io/2018/08/07/node/node使用记录/" data-id="cjnr90az10001ok76smh6i98l" class="article-share-link">分享到</a>
        
      </div>
    </footer>
  </div>
  </div>
  </div>
  
</article>



  
  
    <nav id="page-nav">
      <span class="page-number current">1</span><a class="page-number" href="/cy_home/page/2/">2</a><a class="page-number" href="/cy_home/page/3/">3</a><a class="extend next" rel="next" href="/cy_home/page/2/">Next &raquo;</a>
    </nav>
  
</section>
      
      <aside id="sidebar">
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">近期文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/cy_home/2018/10/27/npm/npm组件发布/">npm + webpack + vue 创建发布一个组件</a>
          </li>
        
          <li>
            <a href="/cy_home/2018/10/27/npm/">npm</a>
          </li>
        
          <li>
            <a href="/cy_home/2018/08/07/node/node使用记录/">node使用记录</a>
          </li>
        
          <li>
            <a href="/cy_home/2018/08/02/doclever/doclever_use/">doclever使用</a>
          </li>
        
          <li>
            <a href="/cy_home/2018/07/31/MongoDB/MongoDB/">MongoDB</a>
          </li>
        
      </ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">标签</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/DOClever/">DOClever</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/MongoDB/">MongoDB</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/doclever/">doclever</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/mock/">mock</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/node/">node</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/npm/">npm</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/rap/">rap</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/taFaceNex/">taFaceNex</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/vue/">vue</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/vue-cli/">vue-cli</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/cy_home/tags/webpack/">webpack</a><span class="tag-list-count">1</span></li></ul>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/cy_home/archives/2018/10/">十月 2018</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/cy_home/archives/2018/08/">八月 2018</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/cy_home/archives/2018/07/">七月 2018</a><span class="archive-list-count">5</span></li></ul>
    </div>
  </div>

  
</aside>
      
    </div>
    <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2018 cy<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
      .
      Theme by <a href="https://github.com/sun11/hexo-theme-paperbox" target="_blank">Paperbox</a>
    </div>
  </div>
</footer>
  </div>
  <nav id="mobile-nav">
  
    <a href="/cy_home/" class="mobile-nav-link">Home</a>
  
    <a href="/cy_home/archives" class="mobile-nav-link">Archives</a>
  
    <a href="/cy_home/about" class="mobile-nav-link">About</a>
  
  <a href="#search" class="mobile-nav-link st-search-show-outputs">搜索</a>
</nav>

  

<!-- totop start -->
<div id="totop">
	<a title="返回顶部"></a>
</div>
<!-- totop end -->

<!-- swiftype search start -->

<!-- swiftype search end -->



<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/lrsjng.jquery-qrcode/0.12.0/jquery.qrcode.min.js"></script>


  <link rel="stylesheet" href="/cy_home/fancybox/jquery.fancybox.css">
  <script src="/cy_home/fancybox/jquery.fancybox.pack.js"></script>


<script src="/cy_home/js/script.js"></script>

</div>
</body>
</html>
